<template>
<view>
  <picker mode="date" :value="curValue" @change="handleChange">
    <view v-if="curValue">{{ curValue }}</view>
    <view v-else class="text-gray-500">点击选择</view>
  </picker>
</view>
</template>
<script setup lang="ts">


import {computed} from "vue";

const props = defineProps({
  value: {
    type: String,
    default: ''
  }
})

const emits = defineEmits(['update:value'])
const curValue = computed({
  get() {
    return props.value
  },
  set(val) {
    emits('update:value', val)
  }
})

const handleChange= (e: any) => {
  curValue.value = e.detail.value;
}



</script>

<style scoped>

</style>